<template>
  <view class="comp__price-detail">
    <view v-for="(norm, index) in normList" :key="index" class="price-row">
      <text class="name-wrapper">
        <text class="name">{{norm.name}}</text>
        <text class="multiple">X</text>
        <text class="number">{{norm.chooseNum}}</text>
      </text>
      <basic-price :price="norm.price | normTotal(norm.chooseNum)" size="28rpx" unitSize="24rpx" weight="600" />
    </view>

    <!-- 总计 -->
    <view class="price-total">
      <text>总价：</text>
      <basic-price :price="totalPrice" size="36rpx" unitSize="24rpx" weight="600" color="#FF5944" unitColor="#FF5944"/>
    </view>
  </view>
</template>
<script>
import math from 'utils/helper/math'
export default {
  name: 'comp__price-detail',

  props: {
    normList: {
      type: Array,
      default: () => []
    },
    totalPrice: Number
  },
  filters: {
    normTotal(price, chooseNum) {
      return math.multiply(price, chooseNum)
    }
  }
}
</script>
<style lang="less">
.comp__price-detail {
  .price-row {
    .flex;
    .flex-between;

    margin: 0 30rpx;
    height: 100rpx;
    line-height: 100rpx;

    border-bottom: 1rpx solid @border_color;
  }

  .multiple {
    font-size: 20rpx;
    margin: 0 12rpx;
  }

  .price-total {
    height: 100rpx;
    line-height: 100rpx;
    margin: 0 30rpx;
    text-align: right;
  }
}
</style>